3.3 \(\int \frac {\cos ^2(x)}{a+a \csc (x)} \, dx\)

Optimal. Leaf size=27 \[ -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\sin (x) \cos (x)}{2 a} \]

[Out]

-1/2*x/a-cos(x)/a+1/2*cos(x)*sin(x)/a

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3872, 2839, 2638, 2635, 8} \[ -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\sin (x) \cos (x)}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]^2/(a + a*Csc[x]),x]

[Out]

-x/(2*a) - Cos[x]/a + (Cos[x]*Sin[x])/(2*a)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2839

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3872

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[((g*C
os[e + f*x])^p*(b + a*Sin[e + f*x])^m)/Sin[e + f*x]^m, x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {\cos ^2(x)}{a+a \csc (x)} \, dx &=\int \frac {\cos ^2(x) \sin (x)}{a+a \sin (x)} \, dx\\ &=\frac {\int \sin (x) \, dx}{a}-\frac {\int \sin ^2(x) \, dx}{a}\\ &=-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a}-\frac {\int 1 \, dx}{2 a}\\ &=-\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 27, normalized size = 1.00 \[ -\frac {x}{2 a}+\frac {\sin (2 x)}{4 a}-\frac {\cos (x)}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^2/(a + a*Csc[x]),x]

[Out]

-1/2*x/a - Cos[x]/a + Sin[2*x]/(4*a)

________________________________________________________________________________________

fricas [A]  time = 0.87, size = 18, normalized size = 0.67 \[ \frac {\cos \relax (x) \sin \relax (x) - x - 2 \, \cos \relax (x)}{2 \, a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="fricas")

[Out]

1/2*(cos(x)*sin(x) - x - 2*cos(x))/a

________________________________________________________________________________________

giac [A]  time = 0.58, size = 44, normalized size = 1.63 \[ -\frac {x}{2 \, a} - \frac {\tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} - \tan \left (\frac {1}{2} \, x\right ) + 2}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{2} a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="giac")

[Out]

-1/2*x/a - (tan(1/2*x)^3 + 2*tan(1/2*x)^2 - tan(1/2*x) + 2)/((tan(1/2*x)^2 + 1)^2*a)

________________________________________________________________________________________

maple [B]  time = 0.30, size = 87, normalized size = 3.22 \[ -\frac {\tan ^{3}\left (\frac {x}{2}\right )}{a \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {2 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{a \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\frac {\tan \left (\frac {x}{2}\right )}{a \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {2}{a \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {\arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a+a*csc(x)),x)

[Out]

-1/a/(tan(1/2*x)^2+1)^2*tan(1/2*x)^3-2/a/(tan(1/2*x)^2+1)^2*tan(1/2*x)^2+1/a/(tan(1/2*x)^2+1)^2*tan(1/2*x)-2/a
/(tan(1/2*x)^2+1)^2-1/a*arctan(tan(1/2*x))

________________________________________________________________________________________

maxima [B]  time = 0.42, size = 81, normalized size = 3.00 \[ \frac {\frac {\sin \relax (x)}{\cos \relax (x) + 1} - \frac {2 \, \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - \frac {\sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} - 2}{a + \frac {2 \, a \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + \frac {a \sin \relax (x)^{4}}{{\left (\cos \relax (x) + 1\right )}^{4}}} - \frac {\arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="maxima")

[Out]

(sin(x)/(cos(x) + 1) - 2*sin(x)^2/(cos(x) + 1)^2 - sin(x)^3/(cos(x) + 1)^3 - 2)/(a + 2*a*sin(x)^2/(cos(x) + 1)
^2 + a*sin(x)^4/(cos(x) + 1)^4) - arctan(sin(x)/(cos(x) + 1))/a

________________________________________________________________________________________

mupad [B]  time = 0.24, size = 17, normalized size = 0.63 \[ -\frac {\frac {x}{2}-\frac {\sin \left (2\,x\right )}{4}+\cos \relax (x)}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a + a/sin(x)),x)

[Out]

-(x/2 - sin(2*x)/4 + cos(x))/a

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\cos ^{2}{\relax (x )}}{\csc {\relax (x )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**2/(a+a*csc(x)),x)

[Out]

Integral(cos(x)**2/(csc(x) + 1), x)/a

________________________________________________________________________________________